<template>
  <div class="keyword-analysis">
    <h2>关键词分析结果</h2>
    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="min-width: 700px">
      <el-tab-pane label="User" name="first">
        <el-table :data="analysisData" style="width: 100%">
          <el-table-column prop="competitor" label="竞品名称" width="180" />
          <el-table-column prop="volume" label="搜索量" width="120" />
          <el-table-column prop="difficulty" label="关键词难度" width="180" />
          <el-table-column prop="cpc" label="CPC" width="120" />
        </el-table>
        <el-empty description="description" />
      </el-tab-pane>
      <el-tab-pane label="Config" name="second">
        <el-empty description="description" />
      </el-tab-pane>
      <el-tab-pane label="Role" name="third">
        <el-empty description="description" />
      </el-tab-pane>
      <el-tab-pane label="Task" name="fourth">
        <el-empty description="description" />
      </el-tab-pane>
    </el-tabs>
  </div>
  <el-divider />
  <el-row class="statistic-row">
    <el-col :span="6">
      <el-statistic title="Daily active users" :value="268500" />
    </el-col>
    <el-col :span="6">
      <el-statistic :value="138">
        <template #title>
          <div style="display: inline-flex; align-items: center">
            Ratio of men to women
            <el-icon style="margin-left: 4px" :size="12">
              <Male />
            </el-icon>
          </div>
        </template>
        <template #suffix>/100</template>
      </el-statistic>
    </el-col>
    <el-col :span="6">
      <el-statistic title="Total Transactions" :value="outputValue" />
    </el-col>
    <el-col :span="6">
      <el-statistic title="Feedback number" :value="562">
        <template #suffix>
          <el-icon style="vertical-align: -0.125em">
            <ChatLineRound />
          </el-icon>
        </template>
      </el-statistic>
    </el-col>
  </el-row>
</template>

<script setup>
import { ref } from 'vue';

const analysisData = ref([
  { competitor: '竞品 A', volume: 15000, difficulty: '中等', cpc: '1.2' },
  { competitor: '竞品 B', volume: 20000, difficulty: '高', cpc: '1.5' },
  { competitor: '竞品 C', volume: 10000, difficulty: '低', cpc: '0.8' },
]);

// 假设这些数据是从API获取的
</script>

<style scoped>
.keyword-analysis {
  margin: 20px;
}

h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.statistic-row {
  display: flex;
  max-width: 1000px;
  margin-left: 50px;
  margin-bottom: 50px;
}
</style>